<template>
  <div class="main">
    <div class="name">
      <span>定时点名称：</span><input type="text" /><span class="tips"
        >(提示：请输入新增定时点名称)</span
      >
    </div>
    <div class="way">
      <span>定时点方式：</span>
      <div class="content"><input type="radio" />按天</div>
      <div class="content"><input type="radio" />按周</div>
      <div class="content"><input type="radio" />特殊定时点</div>
    </div>
    <div class="week">
      <div class="title">按周:</div>
      <div class="day">
        <div v-for="(item, index) in days" :key="index" class="dayContent">
          <input type="checkbox" /><span>{{ item }}</span>
        </div>
      </div>
      <div class="beginTime">
        <span>开始时间：</span>
        <div v-for="(item, index) in times" :key="index" class="content">
          <input type="text" name="" id="" />{{ item }}
        </div>
        <div class="buttons"><button>+</button><button>-</button></div>
      </div>
    </div>
    <div class="control">
      <div class="title">电源控制：</div>
      <div class="underContent">
        <div class="leftContent">
          <span class="child">主 机 电 源 选 择</span>
          <div class="each">
            <span>CH1:</span>
            <div><input type="radio" name="CH1" id="" />开</div>
            <div><input type="radio" name="CH1" id="" />关</div>
            <div><input type="radio" name="CH1" id="" />不控制</div>
          </div>
          <div class="each">
            <span>CH2:</span>
            <div><input type="radio" name="CH2" id="" />开</div>
            <div><input type="radio" name="CH2" id="" />关</div>
            <div><input type="radio" name="CH2" id="" />不控制</div>
          </div>
          <div class="each">
            <span>CH3:</span>
            <div><input type="radio" name="CH3" id="" />开</div>
            <div><input type="radio" name="CH3" id="" />关</div>
            <div><input type="radio" name="CH3" id="" />不控制</div>
          </div>
          <div class="each">
            <span>CH4:</span>
            <div><input type="radio" name="" id="CH4" />开</div>
            <div><input type="radio" name="" id="CH4" />关</div>
            <div><input type="radio" name="" id="CH4" />不控制</div>
          </div>
        </div>
        <div class="rightContent">
          <div class="dc">
            <span class="child">终端强切输出（DC-24V）</span>
            <div class="each">
              <span>CH:</span>
              <div><input type="radio" name="dc" id="" />开</div>
              <div><input type="radio" name="dc" id="" />关</div>
              <div><input type="radio" name="dc" id="" />不控制</div>
            </div>
          </div>
          <div class="sc">
            <span class="child">定时点（SC-短路）控制输出</span>
            <div class="each">
              <span>CH:</span>
              <div><input type="radio" name="sc" id="" />开</div>
              <div><input type="radio" name="sc" id="" />关</div>
              <div><input type="radio" name="sc" id="" />不控制</div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="next"><button @click="nextStep" v-if="showNextButton">下一步</button></div>
  </div>
</template>
<script setup >
import { getCurrentInstance, inject, ref } from "vue";
import { useRoute, useRouter } from "vue-router";
import editMusicVue from "./editMusic.vue";
const router = useRouter();
const route = useRoute();
const days = ref([
  "星期天",
  "星期一",
  "星期二",
  "星期三",
  "星期四",
  "星期五",
  "星期六",
]);
const times = ref(["时", "分", "秒"]);
const currenInstance=getCurrentInstance()
const changeComponent=inject('changeComponent')

const nextStep = () => {
      changeComponent({name:'音源编辑',Components:editMusicVue})
    // currenInstance.proxy.changeComponent(currenInstance.proxy.components+1)
    // console.log("current",currenInstance.proxy.changeComponent)
//   router.push({ path: "/addTimingPointView", query: { data: "next" } });
//   console.log("点击了")
};

const showNextButton=ref(true)



</script>
<style lang="less" scoped>
@import url("./less/editTime.less");
</style>